import { defHttp } from '/@/utils/http/axios';
import { PageResult } from '@/api/model/pageResult';
import { QueryMemberLevelDetailBo } from '@/api/base-data/member-level-detail/model/queryMemberLevelDetailBo';
import { QueryMemberLevelDetailVo } from '@/api/base-data/member-level-detail/model/queryMemberLevelDetailVo';
import { CreateMemberLevelDetailVo } from '@/api/base-data/member-level-detail/model/createMemberLevelDetailVo';
import { ContentTypeEnum } from '@/enums/httpEnum';

const baseUrl = '/basedata/member-level-detail';
const region = 'cloud-api';

/**
 * 查询列表
 * @param params
 * @returns {Promise}
 */
export function query(
  params: QueryMemberLevelDetailVo,
): Promise<PageResult<QueryMemberLevelDetailBo>> {
  return defHttp.get<PageResult<QueryMemberLevelDetailBo>>(
    {
      url: baseUrl + '/query',
      params: params,
    },
    {
      region,
    },
  );
}

/**
 * 新增
 * @param params
 * @returns {Promise}
 */
export function create(params: CreateMemberLevelDetailVo): Promise<void> {
  return defHttp.post<void>(
    {
      url: baseUrl,
      data: params,
    },
    {
      contentType: ContentTypeEnum.FORM_URLENCODED,
      region,
    },
  );
}
